// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.

#pragma once
#include "QvObject.h"
#include "QvXmlDocument.h"

class QvToolkit_Export QvXmlElement : public QvObject
{
public:
    QvXmlElement(IXMLDOMDocument* pIDoc, IXMLDOMElement* pIElement);
    QvXmlElement(QvXmlElement const &);
    QvXmlElement& operator=(QvXmlElement const &);
    virtual ~QvXmlElement();

    QvXmlElement* AddElement(const QvChar* pwszName);
    void AddAttribute(const QvChar* pwszName, const QvChar* pwszValue);
    void AddAttribute(const QvChar* pwszName, long lValue);

    void AddText(const QvChar* pwszText);

private:
    HRESULT AddAttributeInternal(const QvChar* pwszName, VARIANT& varValue);

private:
    IXMLDOMElement  *m_pIElement;
    IXMLDOMDocument *m_pXMLDoc;

};

